#ifndef __USER_FLASH_H__
#define __USER_FLASH_H__

/*********************************************************************
 * INCLUDES
 */
#include "bcomdef.h"
#include "OSAL.h"
#include "OSAL_PwrMgr.h"
#include "OnBoard.h"
#include  "hal_flash.h"

#define USER_DATA_PAGE_SIZE				2048
#define USER_DATA_PAGE					123
#define USER_DATA_START_ADDR			(USER_DATA_PAGE * ((uint16)USER_DATA_PAGE_SIZE / 4))

typedef struct 
{
	uint32 flag; /* 0xA5-有效 */
	uint8  key[16]; /* AES128 */
	uint32 num; /* 累加数 */
} UserDataFlash_t;

void UserFlashInit(void);
void UserFlashRead(UserDataFlash_t *tempUserData);
void UserFlashWrite(UserDataFlash_t *UserData);

#endif
